﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yto.Common.Dependency;
using Yto.Repositories;

namespace com.ytocargo.Core.AcarsInfos
{
    public class AcarsInfoStore : IAcarsInfoStore, ITransient
    {
        private readonly IBaseRepository<AcarsInfo> _rep;
        public AcarsInfoStore(IBaseRepository<AcarsInfo> repository)
        {
            _rep = repository;
        }

        public async Task<List<AcarsInfo>> GetUnSengdListAsync(int maxCount = 0)
        {
            return await _rep.GetListAsync(x => !x.SendFlag, maxCount);
        }

        public async Task<AcarsInfo> UpdateAcarsInfoAsync(AcarsInfo acarsInfo)
        {
            return await _rep.UpdateAsync(acarsInfo);
        }
    }
}
